from django.contrib import admin
from .models import NPC
from import_export.admin import ImportExportModelAdmin


class NPCAdmin(ImportExportModelAdmin, admin.ModelAdmin):
    # 用于在创建用户时使用
    add_fieldsets = ('name', 'city', 'default_place', 'bio')
    list_display = ('name', 'city', 'bio')
    list_display_links = ('name', )
    readonly_fields = ['location', ]
    search_fields = ['name', 'city', 'default_place']


admin.site.register(NPC, NPCAdmin)
